<template>
  <view class="good-list">
    <uni-list>
      <uni-list-item v-for="(item, index) in list" :key="index" showArrow>
        <template slot="header">
          <view class="iconfont icon-yinzhang"></view>
        </template>
        <template slot="body">
          <view class="u-cell-group" @click="printingRecord(item)">
            <view>
              <u-tag :text="item.name" type="success" />
            </view>
            <view>{{$t('印章ID')}}：{{ item.id }}</view>
            <view>{{$t('管章人')}}：{{ item.keeperName }}</view>
          </view>
        </template>
        <template slot="footer">
          <view class="footer" @click="printingRecord(item)">
            <view
              :class="option.name === '实时视频' ? 'icon-jiankongshexiangtou' : 'icon-shipin'"
              class="iconfont"
              style="color: #07aa66; font-size: 26px"
            ></view>
            <!-- <u-tag text="使用记录" style="width:152rpx;" /> -->
          </view>
        </template>
      </uni-list-item>
    </uni-list>
  </view>
</template>

<script>
import { mapGetters, mapMutations } from 'vuex'

export default {
  computed: {
    ...mapGetters(['userInfo', 'api'])
  },
  props: {
    list: {
      type: [Array],
      default() {
        return []
      }
    },
    option: {
      //当前页面信息，从哪里点进的
      type: Object,
      default() {
        return {}
      }
    },
    titleId: {
      //当前tab名称
      type: [Number, String],
      default() {
        return ''
      }
    }
  },
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
    printingRecord(item) {
      if (this.option.name === '实时视频') {
        uni.navigateTo({
          url: '../pusher/pusher?id=' + item.id
        })
      } else {
        uni.navigateTo({
          url: '../player/player?id=' + item.id
        })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.good-list {
  background-color: #fff;
  width: 100%;

  .icon-yinzhang {
    font-size: 50rpx;
    color: #007aff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20rpx;
    height: 140rpx;
  }

  .u-cell-group {
    font-size: 28rpx;
    color: #888;
    line-height: 48rpx;
    width: 540rpx;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .footer {
    display: flex;
    justify-content: end;
    align-items: center;
    height: 140rpx;
  }
}
</style>
